//
//  WeiXinCell.swift
//  WeChat
//
//  Created by henaihan on 2017/10/23.
//  Copyright © 2017年 henaihan. All rights reserved.
//

import UIKit

class WeiXinCell: UITableViewCell, UITableViewDelegate {
    @IBOutlet weak var img: UIImageView!
    @IBOutlet weak var title: UILabel!
    @IBOutlet weak var detail: UILabel!
    @IBOutlet weak var time: UILabel!
    
    var model: WeiXinModel!{
        didSet{
            img.image = UIImage(named: model.pic as String)
            title.text = model.name as String
            detail.text = model.introduce as String
            time.text = model.date as String
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    class func createCell(tableView: UITableView) -> WeiXinCell{
        let cellNib = UINib(nibName: "WeiXinCell", bundle: nil)
        tableView.register(cellNib, forCellReuseIdentifier: "weixincell")
        let cell: WeiXinCell = tableView.dequeueReusableCell(withIdentifier: "weixincell") as! WeiXinCell
        return cell
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        // Configure the view for the selected state
    }
    
}

